package com.iceGame;

import com.badlogic.gdx.Gdx;

import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Assets {

    public static Texture background;
    public static TextureRegion backgroundRegion;
    public static Texture mainMenuBackground;
    public static TextureRegion mainMenuScreen;
    public static TextureRegion backBar;
    public static TextureRegion topBar;
    public static Texture settingBackground;
    public static TextureRegion settingScreen;    
    public static Texture LevelSelectionBackground;
    public static TextureRegion LevelSelectionScreen;
    public static Texture ScoreMenuBackground;
    public static TextureRegion ScoreMenuScreen;

    public static TextureRegion settingButton;
    public static TextureRegion backButton;
    public static Texture items;   
    public static TextureRegion iceCube;
    public static TextureRegion CollectableIceCube;
    public static TextureRegion platform;
    public static TextureRegion iglu;
    
    
    public static Music music;
    public static Sound jumpSound;
    public static Sound gameOverSound;
    public static Sound explosionSound;
    public static Sound collectSound;
    public static Sound endLevelSound;
    public static Sound buttonPressSound;
   


	public static TextureRegion pause; 
	public static TextureRegion mute;
	public static TextureRegion unmute;
	public static TextureRegion fireball;
	public static TextureRegion upLeftSign;
	public static TextureRegion downLeftSign;
	public static TextureRegion upRightSign;
	public static TextureRegion downRightSign;
	public static TextureRegion leftSign;
	public static TextureRegion rightSign;
	public static TextureRegion dangerSign;
	public static TextureRegion lock;
	public static TextureRegion smallScoreStar;
	public static TextureRegion bigScoreStar;
	
	public static TextureRegion gameOverText ;
	public static TextureRegion readyText ;
	public static TextureRegion resumeText;
	public static TextureRegion quitText ;
	public static TextureRegion retryText;
	
	public static Animation fireballExplosion;
	public static Animation fireballAnimation;
	public static Animation fireAnimation;
    public static Texture loadTexture(String file) {
    	return new Texture(Gdx.files.internal(file));
    }
    public static void load() {
    	   	
    	background = loadTexture("data/background1.png");
        backgroundRegion = new TextureRegion(background, 0, 0, 800, 480);
        mainMenuBackground = loadTexture("data/menu.png");
        mainMenuScreen = new TextureRegion(mainMenuBackground,0,0,800,480);
        settingBackground = loadTexture("data/setting.png");
        settingScreen = new TextureRegion(settingBackground,0,0,800,480);
        
        LevelSelectionBackground = loadTexture("data/levelSelection.png");
        LevelSelectionScreen = new TextureRegion(LevelSelectionBackground,0,0,800,480);
        
        ScoreMenuBackground = loadTexture("data/scoreMenu.png");
        ScoreMenuScreen = new TextureRegion(ScoreMenuBackground,0,0,300,190);
        
        
        
        items = loadTexture("data/atlas01-1.png");
        iceCube = new TextureRegion(items,0,0,32,32);
        CollectableIceCube = new TextureRegion(items,0,32,32,32);
        platform = new TextureRegion(items,0,373,117,35);
        iglu = new TextureRegion(items,0,416,200,96);
        
       
        gameOverText = new TextureRegion(items, 225, 189, 287, 51);
        retryText = new TextureRegion(items, 372,242,140,60);
        resumeText = new TextureRegion(items, 332,302,180,53);
        quitText = new TextureRegion(items, 379,355,133,62);
        readyText= new TextureRegion(items, 307,416,205,95);
        
        backBar = new TextureRegion(items,0,92,64,22);
        topBar = new TextureRegion(items,0,132,85,60);
        pause = new TextureRegion(items, 355, 82, 43, 43);
        mute = new TextureRegion(items,435,84,27,32);
        unmute = new TextureRegion(items,403,84,32,32);
        fireball = new TextureRegion(items,464,84,40,40);
        settingButton = new TextureRegion(items,0,196,80,65);
        backButton = new TextureRegion(items,80,198,64,64);       
        dangerSign = new TextureRegion(items, 120,138,41,55);
        rightSign = new TextureRegion(items, 174,138,54,55);
        downLeftSign = new TextureRegion(items, 228,138,54,55);
        downRightSign = new TextureRegion(items, 288,138,49,55);
        leftSign = new TextureRegion(items, 337,138,59,55);
        upLeftSign = new TextureRegion(items, 396,127,55,69);
        upRightSign = new TextureRegion(items, 450,131,52,63);
        lock = new TextureRegion(items, 0,263,64,64);
        smallScoreStar = new TextureRegion(items, 0,114,17,17);
        bigScoreStar = new TextureRegion(items, 66,265,60,60);
        fireballAnimation = new Animation(0.05f, new TextureRegion(items,0,327,40,40),
        										new TextureRegion(items,40,327,40,40),
        										new TextureRegion(items,80,327,40,40),
        										new TextureRegion(items,120,327,40,40));
        fireAnimation = new Animation(0.2f, new TextureRegion(items,256,0,32,32),
        									new TextureRegion(items,288,0,32,32),
        									new TextureRegion(items,320,0,32,32),
        									new TextureRegion(items,352,0,32,32),
        									new TextureRegion(items,384,0,32,32),
        									new TextureRegion(items,416,0,32,32),
        									new TextureRegion(items,448,0,32,32),
        									new TextureRegion(items,480,0,32,32));
        fireballExplosion = new Animation(0.1f,new TextureRegion(items,118,372,40,40),
        										new TextureRegion(items,158,372,40,40),
        										new TextureRegion(items,198,372,40,40),
        										new TextureRegion(items,238,372,40,40));
        music = Gdx.audio.newMusic(Gdx.files.internal("data/sounds/ice2.ogg"));
        jumpSound=Gdx.audio.newSound(Gdx.files.internal("data/sounds/jump.ogg"));
        gameOverSound=Gdx.audio.newSound(Gdx.files.internal("data/sounds/gameOver2.ogg"));
        explosionSound =Gdx.audio.newSound(Gdx.files.internal("data/sounds/fireball2.ogg"));
        collectSound = Gdx.audio.newSound(Gdx.files.internal("data/sounds/ice_collision.ogg"));
        endLevelSound = Gdx.audio.newSound(Gdx.files.internal("data/sounds/end.ogg"));
        buttonPressSound=Gdx.audio.newSound(Gdx.files.internal("data/sounds/click.ogg"));
        music.setLooping(true);
        music.setVolume(0.7f); 
        //music.play();
       
    }
}
